package business;

import java.util.ArrayList;
import java.util.List;

import util.AdviceTimesToAct;
import util.Globals;

public class Advice extends GenericAdvice {
	private List<String> pointcutsReferingList;
	
	public Advice(AdviceTimesToAct timeToAct, String bodyFunction, String pointcutRefering, String pointcutIdsRefering){
		super(timeToAct,bodyFunction);
		if(pointcutIdsRefering!=null){
			/* Splits comma to make a list, and trims all elements. */
			this.pointcutsReferingList = Globals.trimStringList( Globals.splitWithComma(pointcutIdsRefering) );
		}else{
			pointcutsReferingList = new ArrayList<String>();
		}
		pointcutsReferingList.add(pointcutRefering);
	}

	public List<String> getPointcutsReferingList() {
		return pointcutsReferingList;
	}
}
